\(\int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx\) [209]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 4 \[ \int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx=x+\sin (x) \]

[Out]

x+sin(x)

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4477, 2761, 8} \[ \int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx=x+\sin (x) \]

[In]

Int[Sin[x]/(-Cot[x] + Csc[x]),x]

[Out]

x + Sin[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2761

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[g*((g*Cos[e
 + f*x])^(p - 1)/(b*f*(p - 1))), x] + Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2), x], x] /; FreeQ[{a, b, e, f, g
}, x] && EqQ[a^2 - b^2, 0] && GtQ[p, 1] && IntegerQ[2*p]

Rule 4477

Int[(cot[(c_.) + (d_.)*(x_)]^(n_.)*(a_.) + csc[(c_.) + (d_.)*(x_)]^(n_.)*(b_.))^(p_)*(u_.), x_Symbol] :> Int[A
ctivateTrig[u]*Csc[c + d*x]^(n*p)*(b + a*Cos[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\sin ^2(x)}{1-\cos (x)} \, dx \\ & = \sin (x)+\int 1 \, dx \\ & = x+\sin (x) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(14\) vs. \(2(4)=8\).

Time = 0.04 (sec) , antiderivative size = 14, normalized size of antiderivative = 3.50 \[ \int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx=2 \left (\frac {x}{2}+\frac {\sin (x)}{2}\right ) \]

[In]

Integrate[Sin[x]/(-Cot[x] + Csc[x]),x]

[Out]

2*(x/2 + Sin[x]/2)

Maple [A] (verified)

Time = 1.32 (sec) , antiderivative size = 5, normalized size of antiderivative = 1.25

method result size
risch \(x +\sin \left (x \right )\) \(5\)
default \(\frac {2 \tan \left (\frac {x}{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}+2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )\) \(25\)

[In]

int(sin(x)/(csc(x)-cot(x)),x,method=_RETURNVERBOSE)

[Out]

x+sin(x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.00 \[ \int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx=x + \sin \left (x\right ) \]

[In]

integrate(sin(x)/(-cot(x)+csc(x)),x, algorithm="fricas")

[Out]

x + sin(x)

Sympy [F]

\[ \int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx=- \int \frac {\sin {\left (x \right )}}{\cot {\left (x \right )} - \csc {\left (x \right )}}\, dx \]

[In]

integrate(sin(x)/(-cot(x)+csc(x)),x)

[Out]

-Integral(sin(x)/(cot(x) - csc(x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 38 vs. \(2 (4) = 8\).

Time = 0.30 (sec) , antiderivative size = 38, normalized size of antiderivative = 9.50 \[ \int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx=\frac {2 \, \sin \left (x\right )}{{\left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )} {\left (\cos \left (x\right ) + 1\right )}} + 2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

integrate(sin(x)/(-cot(x)+csc(x)),x, algorithm="maxima")

[Out]

2*sin(x)/((sin(x)^2/(cos(x) + 1)^2 + 1)*(cos(x) + 1)) + 2*arctan(sin(x)/(cos(x) + 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 18 vs. \(2 (4) = 8\).

Time = 0.28 (sec) , antiderivative size = 18, normalized size of antiderivative = 4.50 \[ \int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx=x + \frac {2 \, \tan \left (\frac {1}{2} \, x\right )}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1} \]

[In]

integrate(sin(x)/(-cot(x)+csc(x)),x, algorithm="giac")

[Out]

x + 2*tan(1/2*x)/(tan(1/2*x)^2 + 1)

Mupad [B] (verification not implemented)

Time = 23.28 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.00 \[ \int \frac {\sin (x)}{-\cot (x)+\csc (x)} \, dx=x+\sin \left (x\right ) \]

[In]

int(-sin(x)/(cot(x) - 1/sin(x)),x)

[Out]

x + sin(x)